Skip to main content
Version: 1.2.0

LOR-API Documentation

Overview

The LOR-API is a Python-based API that uses OpenSearch. This documentation covers version 1.1.0.

Authentication

All endpoints require Bearer Authentication.

API Endpoints

1. Health Status

Endpoint: /cl/api/v1/health/
Method: GET
Description: Returns the health status of the API.
Response: 200 - Successful response with status message

2. Directory Management

2.1 Root Directory

Endpoint: /cl/api/v1/directory/root

GET
  • Description: Fetches root directory information for a specific tenant
  • Parameters:
    • ext_user_id_ref (optional): External User ID
  • Responses:
    • 200: Root directory found
    • 404: Not found
    • 400: Connection error
    • 500: Internal server error
    • 422: Validation error
POST
  • Description: Creates a root directory for a tenant
  • Request Body: Payload to create root directory
  • Responses:
    • 201: Successfully created
    • 409: Conflict, directory already exists
    • 422: Validation error

/cl/api/v1/directory/root

Request Payload of root (Get Method):

Request Payload:

TypeParameterDescriptionRequired
Query Parameterext_user_id_refExternal user ID reference for the queryYes

/cl/api/v1/directory/root

Request Payload of root (Post Method):

Request Payload:

TypeParameterDescriptionRequired
Query Parameterext_user_id_refExternal user ID reference for the queryYes
Parametertenant_codeTenant code associated with the requestYes

/cl/api/v1/directory/{folder_id}

Request Payload of folder_id (Get Method):

Request Payload:

TypeParameterDescriptionRequired
Query Parameterfolder_idUnique folder ID (UUID format)Yes
Query Parametersorting_bySort result by title or modified_dateNo
Query ParameterorderSort result in ascending or descending orderNo
Query Parameterext_user_id_refExternal user ID reference for the queryYes

Sorting Options:

  • sorting_by: Available values: title, updated_at (Default: updated_at)
  • order: Available values: asc, desc (Default: asc)

/cl/api/v1/directory/{folder_id}

Request Payload of folder_id (Put Method):

Request Payload:

TypeParameterDescriptionRequired
Query Parameterfolder_idFolder ID of the directory to be updatedYes
Query Parameterext_user_id_refExternal user ID reference for the queryYes
ParameternameName of the folderYes
Parameteris_privateWhether the folder is private (true/false)Yes
ParametertypeType of the item (e.g., "Folder")Yes
Parametercustom_metadataCustom metadata for the folderNo

Custom Metadata:

  • kvp: Key-value pairs
  • tags: List of tags
  • taxonomy: List of taxonomy with UUID and title

/cl/api/v1/directory/{folder_id}

Request Payload of folder_id (Post Method):

Request Payload:

TypeParameterDescriptionRequired
Query Parameterfolder_idFolder ID of the directory to be updatedYes
Query Parameterext_user_id_refExternal user ID reference for the queryYes
Parameterdirectory_structureDirectory structure with folders and metadataYes

/cl/api/v1/directory/{folder_id}

Request Payload of folder_id (Delete Method):

Request Payload:

TypeParameterDescriptionRequired
Query Parameterfolder_idFolder ID of the directory to be updatedYes
Query Parameterext_user_id_refExternal user ID reference for the queryYes

/cl/api/v1/directory/details/bulk

Request Payload of bulk:

Request Payload:

TypeParameterDescriptionRequired
Query Parameterext_user_id_refExternal user ID reference for the queryYes
Parameterfolder_idsList of folder IDsYes

/cl/api/v1/directory/aggregate/details

Request Payload of aggregate:

Request Payload:

TypeParameterDescriptionRequired
Query Parameterquery_stringQuery string to search for foldersYes
Query Parametersort_bySort results by title or updated_atNo
Query ParameterorderSort result in ascending or descending orderNo
Query Parameterpage_noPage number for the results (Minimum: 1)No
Query Parameterpage_sizeNumber of results per page (Default: 20)No
Query Parameterext_user_id_refExternal user ID reference for the queryYes
Parameterobject_idsList of object IDs to filter byNo
Parameterfolder_idsList of folder IDs to filter byNo
Parameterwith_exact_searchWhether to search for exact matchesNo
Parameteris_privateWhether the folder is private (true/false)No
Parametercreated_byUser who created the folderNo
Parameterupdated_byUser who last updated the folderNo
Parametercreated_atDate the folder was created (ISO format)No
Parameterupdated_atDate the folder was last updated (ISO format)No
Parametercustom_metadataCustom metadata for filtering foldersNo
Parameteris_anywhereWhether to search anywhere within the folderNo

Sorting Options:

  • sort_by: Available values: title, updated_at (Default: updated_at)
  • order: Available values: asc, desc (Default: asc)

Pagination:

  • page_no: Default value: 1
  • page_size: Default value: 20

Directory Structure:

  • name: Name of the folder
  • is_private: Whether the folder is private (true/false)
  • type: Type of the item (e.g., "Folder")
  • children: List of child items (if any)
  • custom_metadata: Custom metadata associated with the folder
    • kvp: Key-value pairs
    • tags: List of tags
    • taxonomy: List of taxonomy with UUID and title

2.2 Folder Operations

Endpoint: /cl/api/v1/directory/{folder_id}

GET
  • Parameters:
    • folder_id (required): UUID format
    • sorting_by (optional): Sort by title or modified date
    • order (optional): Ascending or descending
  • Responses:
    • 200: Directory found
    • 404: Directory not found
    • 500: Internal server error
    • 422: Validation error
PUT
  • Description: Updates metadata of a directory
  • Parameters:
    • folder_id (required)
    • ext_user_id_ref (optional)
  • Responses:
    • 200: Successfully updated
    • 403: Forbidden (attempt to update root directory)
    • 404: Not found
    • 409: Conflict
    • 422: Validation error
POST
  • Description: Adds directories to existing directory
  • Parameters:
    • folder_id (required): Parent folder ID
    • ext_user_id_ref (optional)
  • Responses:
    • 201: Successfully added
    • 206: Partially added
    • 400: Connection error
    • 404: Parent directory not found
    • 409: Conflict
    • 422: Validation error
DELETE
  • Description: Deletes directory and child directories
  • Parameters:
    • folder_id (required)
    • ext_user_id_ref (optional)
  • Responses:
    • 200: Successfully deleted
    • 403: Forbidden (root directory)
    • 404: Directory not found
    • 422: Validation error

3. Object Management

3.1 Create Object

Endpoint: /cl/api/v2/objects
Method: POST

  • Parameters:
    • ext_user_id_ref (optional)
  • Request Body: ObjectCreatePayloadV2
  • Responses:
    • 200: Object created successfully
    • 400: Invalid argument
    • 404: Object not found
    • 500: Internal server error
    • 422: Validation error

3.2 Get Object Details

Endpoint: /cl/api/v2/objects/{object_id}
Method: GET

  • Parameters:
    • object_id (required): UUID
    • ext_user_id_ref (optional)
  • Responses:
    • 200: Object details retrieved
    • 404: Object not found
    • 400: Invalid argument
    • 500: Internal server error
    • 422: Validation error

3.3 Update Object

Endpoint: /cl/api/v2/objects/{object_id}
Method: PUT

  • Parameters:
    • object_id (required): UUID
    • ext_user_id_ref (optional)
  • Request Body: ObjectUpdatePayloadV2
  • Responses:
    • 200: Object updated successfully
    • 404: Object not found
    • 400: Invalid argument
    • 500: Internal server error
    • 422: Validation error

/cl/api/v2/objects

Request Payload of objects:

Request Payload:

TypeParameterDescriptionRequired
Query Parameterext_user_id_refExternal user ID reference for the queryYes
Parameterobject_idUnique identifier of the objectYes
ParametercodeCode associated with the objectYes
Parameterversion_labelVersion label of the objectYes
Parameterobject_typeType of the object (e.g., "Document")Yes
ParametertitleTitle of the objectNo
ParameterdescriptionDescription of the objectNo
ParameterreposList of repositories associated with the objectNo
ParameterfoldersList of folders associated with the objectNo
Parametersystem_metadataSystem metadata detailsNo
Parametercustom_metadataCustom metadata associated with the objectNo
Parametermedia_metadataMedia-specific metadata detailsNo
Parametersource_system_metadataMetadata about the source systemNo

System Metadata:

  • source: Source of the object
  • is_private: Whether the object is private (true/false)
  • is_deleted: Whether the object is deleted (true/false)
  • is_lga: Legal age group (e.g., "G")
  • license_expiration_date: License expiration date (ISO format)
  • license_validity: Whether the license is valid (true/false)
  • created_by_name: Name of the user who created the object
  • is_latest_version: Whether the object is the latest version (true/false)
  • source_category: Source category of the object
  • extracted_text_file_url: URL to the extracted text file

Custom Metadata:

  • tags: List of tags
  • kvp: Key-value pairs with metadata IDs
  • taxonomy: Taxonomy-related metadata
  • settings: Additional settings

Media Metadata:

  • transcription_details: Details about transcription (ID, language, URL, label)
  • streaming_details: Streaming metadata (resolution, URL, label)
  • image_details: Image metadata (height, width, thumbnail, credit line, additional metadata)

Source System Metadata:

  • source_system_id: Unique identifier for the source system
  • connector_info: Connector-related information
  • source_url: Source URL of the object

/cl/api/v2/objects/{object_id}

Request Payload of objects (Put Method):

Request Payload:

TypeParameterDescriptionRequired
Query Parameterobject_idObject ID of an existing object (UUID)Yes
Query Parameterext_user_id_refExternal user ID reference for the queryYes

/cl/api/v2/objects/{object_id}

Request Payload of objects (Delete Method):

Request Payload:

TypeParameterDescriptionRequired
Query Parameterobject_idObject ID of an existing object to be updated (UUID)Yes
Query Parameterext_user_id_refExternal user ID reference for the queryYes
Parameterversion_labelVersion label of the objectNo
Parameterobject_typeType of the object (e.g., "Document")Yes
Parametercreate_new_versionFlag to indicate if a new version should be created (true/false)No
ParametertitleTitle of the objectNo
ParameterdescriptionDescription of the objectNo
Parameterfile_nameFile name of the objectNo
Parameterfile_extensionFile extension of the objectNo
ParameterassociationList of associated objectsNo
ParameteruriURI of the objectNo
ParameterreposList of repositories associated with the objectNo
ParameterfoldersList of folders associated with the objectNo
Parametersystem_metadataSystem metadata detailsNo
Parametercustom_metadataCustom metadata associated with the objectNo
Parametermedia_metadataMedia-specific metadata detailsNo

System Metadata:

  • source: Source of the object
  • is_private: Whether the object is private (true/false)
  • is_deleted: Whether the object is deleted (true/false)
  • is_lga: Legal age group (e.g., "G")
  • license_expiration_date: License expiration date (ISO format)
  • license_validity: Whether the license is valid (true/false)
  • created_by_name: Name of the user who created the object
  • is_latest_version: Whether the object is the latest version (true/false)
  • source_category: Source category of the object
  • extracted_text_file_url: URL to the extracted text file

Custom Metadata:

  • tags: List of tags
  • kvp: Key-value pairs with metadata IDs
  • taxonomy: Taxonomy-related metadata
  • settings: Additional settings

Media Metadata:

  • transcription_details: Details about transcription (ID, language, URL, label)
  • streaming_details: Streaming metadata (resolution, URL, label)
  • image_details: Image metadata (height, width, thumbnail, credit line, additional metadata)

/cl/api/v2/objects/{object_id}

Request Payload of objects (Delete Method):

Request Payload:

TypeParameterDescriptionRequired
Query Parameterobject_idObject ID of an existing object (UUID)Yes
Query Parameterext_user_id_refExternal user ID reference for the queryYes

/cl/api/v2/objects/{object_id}/uploadfile

Request Payload of objects Uploadfile:

Request Payload:

TypeParameterDescriptionRequired
Query Parameterobject_idObject ID of an existing object (UUID)Yes
Query Parameterauto_chunkAuto-chunk the file (Default value: true)No
Query Parameterauto_generate_alt_textAuto-generate alternative text (Default value: false)No
Query Parameterauto_generate_ccAuto-generate closed captions (Default value: false)No
Query Parameterext_user_id_refExternal user ID reference for the queryYes
ParameterfileFile to be uploaded in the repository against an existing object (binary format)Yes

/cl/api/v2/objects/{object_id}/versions/{version_id}/uploadfile

Request Payload of objects:

Request Payload:

TypeParameterDescriptionRequired
Query Parameterobject_idObject ID of an existing object (UUID)Yes
Query Parameterversion_idVersion ID of the existing object (UUID)Yes
Query Parameterauto_chunkAuto-chunk the file (Default value: true)No
Query Parameterauto_generate_alt_textAuto-generate alternative text (Default value: false)No
Query Parameterauto_generate_ccAuto-generate closed captions (Default value: false)No
Query Parameterext_user_id_refExternal user ID reference for the queryYes
ParameterfileFile to be uploaded in the repository (binary format)Yes

/cl/api/v2/objects/{object_id}/versions/{version_id}

Request Payload of objects versions (Get Method):

Request Payload:

TypeParameterDescriptionRequired
Query Parameterobject_idObject ID of an existing object (UUID)Yes
Query Parameterversion_idVersion ID of the existing object (UUID)Yes
Query Parameterext_user_id_refExternal user ID reference for the queryYes

/cl/api/v2/objects/{object_id}/versions/{version_id}

Request Payload of objects versions (Delete Method):

Request Payload:

TypeParameterDescriptionRequired
Query Parameterobject_idObject ID of an existing object (UUID)Yes
Query Parameterversion_idVersion ID of the existing object (UUID)Yes
Query Parameterext_user_id_refExternal user ID reference for the queryYes

/cl/api/v2/objects/folders/bulk

Request Payload of objects versions:

Request Payload:

TypeParameterDescriptionRequired
Query Parameterext_user_id_refExternal user ID reference for the queryYes

/cl/api/v2/objects/move/bulk

Request Payload of objects versions:

Request Payload:

TypeParameterDescriptionRequired
Query Parameterext_user_id_refExternal user ID reference for the queryYes
Parameterobject_idsList of object IDsYes
Parameterfolder_idsList of folder IDsYes
Parameterupdate_fieldsFields to be updatedYes

Update Fields:

  • parent_id: Parent folder ID (string)
  • is_private: Whether the object/folder is private (boolean)

/cl/api/v2/objects/associations

Request Payload of associations:

Request Payload:

TypeParameterDescriptionRequired
Query Parameterext_user_id_refExternal user ID reference for the queryYes
ParameteridUnique identifier (UUID)Yes
ParametertypeRelationship type (e.g., "isEmbeddedOf")Yes
ParameteroriginOrigin details of the objectYes
ParameterdestinationDestination details of the objectYes
ParametersourceSource informationNo
ParametermodeOperation mode (e.g., "ADD")Yes

Origin Fields:

  • object_id: Object ID of the origin (string)
  • version_id: Version ID of the origin (string)
  • version_no: Version number of the origin (integer)

Destination Fields:

  • object_id: Object ID of the destination (string)
  • version_id: Version ID of the destination (string)

/cl/api/v2/objects/associations/{object_id}/versions/{version_id}

Request Payload of associations versions:

Request Payload:

TypeParameterDescriptionRequired
Query Parameterobject_idObject ID of an existing object (UUID)Yes
Query Parameterversion_idVersion ID of the existing object (UUID)Yes
Query Parameterext_user_id_refExternal user ID reference for the queryYes

/cl/api/v2/objects/usagecount/{object_id}/versions/{version_id}

Request Payload of usagecont versions:

TypeParameterDescriptionRequired
Query Parameterobject_idObject ID of an existing object (UUID)Yes
Query Parameterversion_idVersion ID of the existing object (UUID)Yes
Query Parameterext_user_id_refExternal user ID reference for the queryYes

/cl/api/v2/objects/deassociations/bulk

Request Payload of deassociations bulk:

Request Payload:

TypeParameterDescriptionRequired
Query Parameterext_user_id_refExternal user ID reference for the queryYes
ParameteridsList of IDs to be processedYes
ParametermodeOperation mode (e.g., "REMOVE")Yes

/cl/api/v2/objects/

Request Payload of objects:

Request Payload:

TypeParameterDescriptionRequired
Query Parameterfolder_idFolder ID (UUID)Yes
Query Parametersorting_bySort result by title or modified date (Available: None, title, updated_at)No
Query ParameterorderSort result in ascending or descending order (Available: asc, desc)No
Query Parameterobject_typeList of object types (Available: Document, Audio, Video, Image, Course, Rubric, Assessment, Assignment, Question, ExternalTool, Glossary, DiscussionForum, Page, Quiz, Outcomes)No
Query Parameterchat_session_idChat session ID (UUID)No
Query Parameterpage_noPage number (Default: 1)No
Query Parameterpage_sizeRecords per page (Default: 20)No
Query Parameterext_user_id_refExternal user ID reference for the queryYes

4. File Operations

4.1 Upload File

Endpoint: /cl/api/v3/file_upload
Method: POST

  • Parameters:
    • folder_id (required): UUID
    • source_category (required): KnowledgeBase/Guideline/OutputTemplate/InputFile
    • session_id (required): UUID
    • ext_user_id_ref (optional)
  • Content-Type: multipart/form-data
  • Responses:
    • 200: File upload successful
    • 404: File not valid
    • 400: Invalid argument
    • 500: Internal server error
    • 422: Validation error

/cl/api/v2/directory/

Request Payload of directory:

TypeParameterDescriptionRequired
Query Parameterobject_idObject ID of an existing object (UUID)Yes
Query Parameterversion_idVersion ID of the existing object (UUID)Yes
Query Parameterext_user_id_refExternal user ID reference for the queryYes

Data Models

Core Models

MetadataBaseModel

{
"kvp": "object",
"tags": "array[string]",
"taxonomy": "array[object]"
}

ObjectCreatePayloadV2

{
"object_id": "uuid",
"code": "string",
"version_label": "string",
"object_type": "string",
"title": "string",
"description": "string",
"repos": "array",
"folders": "array"
}

ObjectUpdatePayloadV2

{
"version_label": "string",
"object_type": "string",
"create_new_version": "boolean",
"title": "string",
"description": "string",
"file_name": "string",
"uri": "string",
"repos": "array",
"folders": "array"
}

Response Models

ObjectResponse

{
"status": "string",
"message": "string",
"data": "Object | MediaObject"
}

FileUploadResponse

{
"status_code": "number",
"message": "string",
"data": [
{
"object_id": "uuid",
"file_name": "string",
"status": "string"
}
]
}

/cl/api/v2/chunks/search

Request Payload:

TypeParameterDescriptionRequired
Query ParameterembeddingEmbedding flag (Default value: false)No
Query Parameterpage_noPage Number (Default value: 1)No
Query Parameterpage_sizeRecords per Page (Default value: 20)No
Query Parameterext_user_id_refExternal user ID reference (string)Yes
ParametermetadataMetadata containing page numberYes
Parameterobject_idsList of object IDsYes

/cl/api/v2/chunks

Request Payload of chunks:

Request Payload:

TypeParameterDescriptionRequired
Query Parameterext_user_id_refExternal user ID reference (string)Yes
Parameterchunk_idChunk IDYes
Parameterobject_idObject IDYes
ParameterembeddingEmbedding flagYes

/cl/api/v2/chunks/{chunk_id}

Request Payload of Put chunks using chunk_id:

Request Payload:

TypeParameterDescriptionRequired
Query Parameterchunk_idChunk ID of an existing object to be updatedYes
Query Parameterext_user_id_refExternal user ID reference (string)Yes
ParametertextText contentYes
ParametermetadataMetadata informationYes

/cl/api/v2/chunks/{chunk_id}

Request Payload of Delete chunks using chunk_id:

Request Payload:

TypeParameterDescriptionRequired
Query Parameterchunk_idChunk ID of an existing object chunk to be deletedYes
Query Parameterext_user_id_refExternal user ID reference (string)Yes

/cl/api/v2/chunks/

Request Payload of chunks/ :

Request Payload:

TypeParameterDescriptionRequired
Query Parameterext_user_id_refExternal user ID reference (string)Yes
Parameterobject_idObject IDYes
Parameterversion_idVersion IDYes
ParametertextText contentYes
ParametermetadataMetadata informationYes

/cl/api/v2/chunks/bulk

Request Payload of Chunks Bulk :

Request Payload:

TypeParameterDescriptionRequired
Query Parameterext_user_id_refExternal user ID reference (string)Yes
ParameterchunksList of chunks containing:Yes
└ object_id└ Object IDYes
└ version_id└ Version IDYes
└ text└ Text contentYes
└ metadata└ Metadata informationYes

/cl/api/v2/chunks/object/bulk

Request Payload of Delete Chunks Bulk :

Request Payload:

TypeParameterDescriptionRequired
Query Parameterext_user_id_refExternal user ID reference (string)Yes
Parameterobject_idsList of object IDsYes

/cl/api/v3/file_upload\

Request Payload of File Upload :

Request Payload:

TypeParameterDescriptionRequired
Query Parameterfolder_idThe folder ID where the files should be uploaded (UUID)Yes
Query Parametersource_categoryThe category of the source from where the file is uploaded. Allowed values:Yes
- KnowledgeBase
- Guideline
- OutputTemplate
- InputFile
Query Parametersession_idThe session ID for the chat interface (UUID)Yes
Query Parameterext_user_id_refExternal user ID reference (string)Yes
ParameterfilesList of files to be uploadedYes

Error Handling

  • All endpoints may return the following error responses:
  • 400: Bad Request - Invalid argument error
  • 404: Not Found - Resource not found
  • 422: Validation Error - Request validation failed
  • 500: Internal Server Error - Server-side error

Security

  • All endpoints require Bearer Authentication
  • Token URL: /cl/api/v1/token
  • Authentication type: OAuth2 with client credentials flow